<?
function smarty_function_search_in_form_data($params,&$smarty) {
  global $setupdata, $mysqlclass;
  $result = array();
  $query = mysql_real_escape_string($params["query"]);

		$q = "
			SELECT DISTINCT `parent`
			FROM `".$setupdata['table_prefix']."form_post_data`
      WHERE `value` LIKE '%".$query."%'
		";
		$sql = $mysqlclass->mysql_my_query($q, __LINE__, __FILE__);
		while ($row = mysql_fetch_array($sql, MYSQL_ASSOC)) {
			$result[$row['parent']] = $row['parent'];
		}
    $params['assign']?$smarty->assign($params['assign'], $result):$result;
}
?>
